{_include admin_menu}

<div class="left_content">
	<legend>จัดการสถานะผู้ใช้</legend>
	<a href="<?php echo base_url('admin/group/add'); ?>"  class="btn btn-primary" > Add Group </a>
	 	<?php
	 	if(!empty($groups)){
	 	?>
	 		<table class="table">
	 		<thead>
				<tr>
					<td> <b><font size="3">ID</font></b></td>
					<td ><b><font size="3">Group Name</font>  </b></td>
					<td><b><font size="3">Edit & Del </font></b></td>
				</tr>
			</thead>
			<tbody >
	 	<?php
	 		foreach($groups as $group) {
	 	?>
				<tr>
					<td  class="span2"><?php echo $group['id']; ?></td>
					<td><?php echo $group['name']; ?></td>
					<td class="span2">
						<a href="<?php echo base_url('admin/group/delete/'.$group['id']); ?>" onClick="return confirm('คุณมั่นใจว่า จะลบtagนี้จิงๆ ใช่มั้ย !');" class="imageedit"><img src="<?php echo $imagepath;?>/x.png"/></a> &nbsp; 
						<a href="<?php echo base_url('admin/group/add/'.$group['id']); ?>"  class="imageedit"><img src="<?php echo $imagepath;?>/edit.png"  /></a>
					</td>
				</tr>
		<?php
			} // End foreach
		?>
				</tbody>
			</table>
		<?php
		}else{
			echo "Empty List";
		} // End if
		?>
	<a href="<?php echo base_url('admin/group/add'); ?>"  class="btn btn-primary" > Add Group </a>
</div>
